﻿using TestingConcurrencyBenchmark.Benchmarks.BenchmarkTests;
using TestingConcurrencyBenchmark.ProblemFactories;
using TestingConcurrencyBenchmark.Problems.ReadersWriters;

namespace TestingConcurrencyBenchmark.Benchmarks
{
    public class ReadersWritersBenchmark : AbstractBenchmark<IReaderWriter>
    {
        private readonly int _nbReaders;
        private readonly int _nbWriters;

        public ReadersWritersBenchmark(int nbReaders, int nbWriters) : base(new ReadersWritersFactory())
        {
            _nbReaders = nbReaders;
            _nbWriters = nbWriters;
        }

        protected override BenchmarkTest<IReaderWriter> CreateBenchmarkTest(IReaderWriter solution)
        {
            return new ReadersWritersTest(solution, _nbReaders, _nbWriters);
        }
    }
}